package class01;

class Person {
    public String name;
}

public class TestMain {
    public static void main(String[] args) {
        Person p = new Person();
        p.name = "lili";
        Person p2 = new Person();
        p2.name = "lili";
        System.out.println(p.name.equals(p2.name)); //true
        System.out.println(p.name == p2.name);//true
        System.out.println(p.name == "lili");//true


        String s1 = "javaEE";
        System.out.println(System.identityHashCode(s1));
        String s2 = "javaEE";
        String s3 = new String("javaEE");
        String s4 = new String("javaEE");

        System.out.println(s1 == s2);//true
        System.out.println(s1 == s3);//false
        System.out.println(s1 == s4);//false
        System.out.println(s3 == s4);//false





    }


}
